import { ApiProperty } from "@nestjs/swagger";
import { IsOptional, IsString, Max, Min, MinLength } from "class-validator";

export class CreateClientDto {
  @IsString()
  @ApiProperty({
    description: "客户姓名",
  })
  @MinLength(1)
  name: string;

  @IsOptional()
  @IsString()
  @ApiProperty({
    required: false,
    description: "字母简称, 用于方便检索",
  })
  short?: string;

  @IsOptional()
  @IsString()
  @ApiProperty({
    required: false,
    description: "地址",
  })
  address?: string;

  @IsOptional()
  @IsString()
  @ApiProperty({
    required: false,
    description: "联系方式",
  })
  contact?: string;

  @IsOptional()
  @IsString()
  @ApiProperty({
    required: false,
    description: "月结日期",
  })
  @Min(0)
  @Max(28)
  summary?: number;
}
